<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>查看招生目录</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
            background-color: #f4f4f4;
        }
        .container {
            width: 80%;
            text-align: center;
            overflow-x: auto;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin: 20px 0;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }
        th, td {
            padding: 12px;
            text-align: center;
            border: 1px solid #ddd;
        }
        th {
            background-color: #007bff;
            color: white;
        }
        td {
            background-color: #f9f9f9;
        }

        /* 固定表头 */
        thead {
            position: sticky;
            top: 0;
            background-color: #007bff;
            z-index: 1;
        }

        /* 设置表格的最大高度并启用滚动条 */
        .table-container {
            max-height: 700px;  /* 限制表格显示的最大高度 */
            overflow-y: auto;   /* 超出部分启用垂直滚动条 */
        }
    </style>
</head>
<body>
<div class="container">
    <h1>招生目录</h1>
    <div class="table-container">
        <table>
            <thead>
            <tr>
                <th>学院</th>
                <th>一级学科</th>
                <th>二级学科</th>
                <th>研究方向</th>
                <th>导师姓名</th>
                <th>类型</th>
                <th>是否全日制</th>
                <th>描述</th>
                <th>备注</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach var="item" items="${catalogList}">
                <tr>
                    <td>${item.collegeName}</td>
                    <td>${item.primaryDiscipline}</td>
                    <td>${item.secondaryDiscipline}</td>
                    <td>${item.researchName}</td>
                    <td>${item.mentorName}</td>
                    <td>${item.type}</td>
                    <td>${item.fullTime}</td>
                    <td>${item.description}</td>
                    <td>${item.remarks}</td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>
</div>
</body>
</html>
